﻿#include "IniTest.h"

using namespace SystemTool;
using namespace SystemTool::IO;

int TestIni()
{
	try
	{
		Ini IniParser;

		IniParser.Configure("C:/Users/Administrator/Desktop/ini_test.txt");

		/*std::string strName = "";

		IniParser.GetKey("App", "name", strName);

		std::cout << strName << std::endl;

		double dValue = 0;

		IniParser.GetKey("Storage", "pathNo", dValue);

		std::cout << dValue << std::endl;

		bool bValue = 0;

		IniParser.GetKey("Storage", "bIsUsed", bValue);

		std::cout << bValue << std::endl;

		int iValue = 0;

		IniParser.GetKey("Storage", "size", iValue);

		std::cout << iValue << std::endl;*/

		IniParser.SetKey("App", "name1", "你好吗");

		IniParser.SetKey("App", "name2", 12);

		IniParser.SetKey("App", "name3", 5.78);

		IniParser.SetKey("App", "name4", true);
	}
	catch (BSException& e)
	{
		std::cout << e.ErrorMsg() << std::endl;

		return -1;
	}

	return 0;
}
